package com.demo.singleton;

/**
 * @Author: shubin_yao
 * @Date: 2022/05/10/21:37
 * @Description:
 * 饿汉模式: 线程安全
 * 缺点: 频繁创建实例
 *
 */
public class Singleton_03 {

    private static Singleton_03 instance = new Singleton_03();

    private Singleton_03() {
        System.out.println("=======饿汉模式: 线程安全,构造方法Singleton_03");
    }

    public static  Singleton_03 getInstance() {
        return instance;
    }

}
